//
//  FeedBackTableViewCell.m
//  fitnessmanage
//
//  Created by wujian on 2017/12/18.
//  Copyright © 2017年 zongquankeji. All rights reserved.
//

#import "FeedBackTableViewCell.h"

@implementation FeedBackTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        /**
         名字
         */
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.font = MidBigFont;
        nameLabel.textColor = CSColorFromRGB(0x0a0a0a);
        [self.contentView addSubview:nameLabel];
        self.nameLabel = nameLabel;
        
        
        /**
         右侧图片
         */
        UIImageView *rightImageView = [[UIImageView alloc] init];
        rightImageView.image = [UIImage imageNamed:@"xiayibu"];
        [self.contentView addSubview:rightImageView];
        self.rightImageView = rightImageView;
        
        [self setConstraints];
        
    }
    
    return self;
}

-(void)setConstraints{
    
 
    [self.nameLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
       
        make.centerY.mas_equalTo(self.contentView);
        
        make.left.mas_equalTo(self.contentView).offset(15);
    }];
    
    [self.rightImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(self.contentView);
        
        make.right.mas_equalTo(self.contentView).offset(-15);
    }];
}

- (void)drawRect:(CGRect)rect
{
    CGContextRef context =UIGraphicsGetCurrentContext();
    
    CGContextBeginPath(context);
    
    CGContextSetLineWidth(context,1.0);//线宽度
    
    CGContextSetStrokeColorWithColor(context,LineBackGroundColor.CGColor);
    
    CGContextMoveToPoint(context,self.nameLabel.left,rect.size.height);
    
    CGContextAddLineToPoint(context,SCREEN_WIDTH,rect.size.height);
    
    CGContextStrokePath(context);
}

@end
